# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=chainsaw
pkgver=v2.13.1.r4.gc692405
pkgrel=1
pkgdesc='A powerful ‘first-response’ capability to quickly identify threats within Windows event logs.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-defensive' 'blackarch-forensic'
        'blackarch-windows')
url='https://github.com/countercept/chainsaw'
license=('GPL3')
makedepends=('git' 'cargo')
source=("git+https://github.com/countercept/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  cargo build --release
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
}

